package sw6.visualschedule.extendedViews;

import sw6.visualschedule.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 *	A narrow separator-entry with text. Useful in a SackOfViews-adapter to emulate
 *	the default Android Settings-separators. 
 */
public class SeperatorEntry extends LinearLayout {
	
	private final transient TextView mText;
	
	public TextView getText() {
		return mText;
	}
	
	public SeperatorEntry(final Context context) {
	   super(context);

	   final LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	   layoutInflater.inflate(R.layout.seperatorentry,this);
	   mText = (TextView)findViewById(R.id.seperator_text);
	}
	
	public SeperatorEntry(final Context context, final String text) {
		super(context);

		final LayoutInflater layoutInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		layoutInflater.inflate(R.layout.seperatorentry,this);
		mText = (TextView)findViewById(R.id.seperator_text);
		mText.setText(text);
	}
	
}
